<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition  xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:ui="http://java.sun.com/jsf/facelets"
                 xmlns:f="http://java.sun.com/jsf/core"
                 xmlns:h="http://java.sun.com/jsf/html"
                 xmlns:c="http://java.sun.com/jsp/jstl/core"
                 xmlns:pou="http://primefaces.org/ui">
    <!-- ${facesContext.externalContext.requestContextPath} -->
    <pou:panel header="Cargas de Datos">
        <h:panelGrid>
            <pou:commandButton  value="Nueva Carga" ajax="false"  actionListener="#{mbIndex.loadPage('cargamasiva.xhtml')}" ></pou:commandButton>
            <pou:dataTable rows="10" paginator="true" value="#{mbCargasDatos.cargas}" var="c" rowKey="${c.id}" selectionMode="single"
                           selection="#{mbCargasDatos.selected}">
                <pou:ajax event="rowSelect" listener="#{mbCargasDatos.actionSelect()}"   
                          update="@form" onstart="dlgwait.show()" onsuccess="dlgwait.hide()"  />  
                <pou:column headerText="Año" sortBy="#{c.anio}" filterBy="#{c.anio}">
                    <h:outputText value="#{c.anio}" />
                </pou:column>
                <pou:column headerText="Mes" sortBy="#{c.mes}" >
                    <h:outputText value="#{mbCargasDatos.meses[c.mes].nombreMes}" />
                </pou:column>
                <pou:column headerText="Fecha Carga">
                    <h:outputText value="#{c.fecha}">
                        <f:convertDateTime pattern="dd/MM/yyyy" />
                    </h:outputText>
                </pou:column>
                <pou:column headerText="Tipo">
                    <h:outputText  value="ASOFF" rendered="#{c.asoff}" />
                    <h:outputText  value="CHEQUES RECH." rendered="#{c.chequesRechazados}" />
                    <h:outputText  value="ORDENESCA" rendered="#{c.ordenes}" />
                    <h:outputText  value="ORDENESCA RET." rendered="#{c.ordenesRetenidas}" />
                    <h:outputText  value="VENTAS" rendered="#{c.ventas}" />
                </pou:column>
            </pou:dataTable>
            <ui:include rendered="#{mbCargasDatos.showNavigator}" src="../generic/navigator.xhtml" />
        </h:panelGrid>
    </pou:panel>
</ui:composition>